$(function (){
    $("img").viewer();
    $(".width150").on("mouseenter",function() {
        var that = this;
        var text = $(this).find("input").val();
        layer.tips(text, that,{
            tips: 1,
            time: 2000         //设置显示时间
        });

    });
})

function delGoods (obj,gId) {

    let $this = $(obj)

    console.log("gId" + gId)

    axios.get( "/admin/delGoods2/" + gId).then(function (res){
        console.log(res.data)
        if(res.data >0){
            $this.parent().parent().remove();
            $("#msg").html("删除成功")
        }else{
            $("#msg").html("删除失败")
        }
    })

}
function delGoods (obj,gId) {

    let $this = $(obj)

    console.log("gId" + gId)

    axios.get( "/admin/delGoods/" + gId).then(function (res){
        console.log(res.data)
        if(res.data >0){
            $this.parent().parent().remove();
            $("#msg").html("删除成功")
        }else{
            $("#msg").html("删除失败")
        }
    })

}

function delCategory (obj,gId) {

    let $this = $(obj)

    console.log("gId" + gId)

    axios.get("/admin/delCategory/" + gId).then(function (res) {
        console.log(res.data)
        if (res.data > 0) {
            $this.parent().parent().remove();
            $("#msg").html("删除成功")
        } else {
            $("#msg").html("删除失败")
        }
    })
}